package com.ncst.backend.mapper;

import com.ncst.backend.domain.MedicalRecord;
import com.ncst.backend.domain.MedicalTechnology;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 病历Mapper接口
 */
@Mapper
public interface MedicalRecordMapper {

    MedicalRecord selectById(@Param("id") Integer id);
    List<MedicalRecord> selectAll();
    List<MedicalRecord> selectByCondition(MedicalRecord medicalRecord);
    List<MedicalRecord> selectByPage(@Param("offset") Integer offset, @Param("limit") Integer limit);
    Long countAll();
    Long countByCondition(MedicalRecord medicalRecord);
    int insert(MedicalRecord medicalRecord);
    int insertBatch(@Param("list") List<MedicalRecord> list);
    int updateById(MedicalRecord medicalRecord);
    int deleteById(@Param("id") Integer id);
    int deleteByIds(@Param("ids") List<Integer> ids);
    MedicalRecord selectByRegisterId(@Param("registerId") Integer registerId);

    List<MedicalRecord> selectByCaseNumberOrRealName(@Param("caseNumber") String caseNumber, @Param("realName") String realName);

    List<MedicalTechnology> selectMedicalTechnologyByCaseNumberOrRealName(@Param("caseNumber") String caseNumber, @Param("realName") String realName);

    void insertMedicalRecordDiseases(@Param("medicalRecordId") int medicalRecordId, @Param("diagnosisList") List<Integer> diagnosisList);

    int menZhenQueZhen(@Param("registerId") String registerId,@Param("diagnosis") String diagnosis,@Param("cure") String cure);
}
